import http, {HttpOptions} from "../http"

export interface perInfo {
    id: number;
    perName: string;
    perPath: string;
    perMod: string;
    description: string;
    updateBy: string;
    updateTime: string;
    status: number;
}

// 响应接口
export interface GetPerListRes {
    code: number;
    msg: string;
    data: {
        total: number;
        size: number;
        current: number;
        records: {
            id: number;
            perName: string;
            perPath: string;
            perMod: string;
            description: string;
            updateBy: string;
            updateTime: string;
            status: number;
        }[];
    };
    timestamp: number;
    now: string;
}



/**
 * 获取API列表
 * @param {string} page
 * @param {string} size
 * @returns
 */
export function getPerList(page: number, size: number): Promise<GetPerListRes> {
    const config: HttpOptions = {
        msg: false,
        token: true,
        load: false,
    }
    return http.get(`/per/list?page=${page}&size=${size}`, config);
}